package org.whuims.entity;

import org.apache.solr.client.solrj.beans.Field;
import org.springframework.data.solr.core.mapping.SolrDocument;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by zhongwei on 2017/1/1.
 */
@Entity
@Table(name = "document")
@SolrDocument(solrCoreName = "docs_document")
public class Document extends IdEntity {

    @Field(value = "userId")
    private Long userId;
    @Field(value = "language")
    private String language;
    @Field(value = "title")
    private String title;
    @Field(value = "description")
    private String description;
    @Field(value = "subject")
    private String subject;
    @Field(value = "createDate")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date createDate;
    @Field(value = "location")
    private String location;
    @Field(value = "tags")
    private String tags;
    @Field(value = "content")
    private String content;
    @Field(value = "searchFields")
    private String searchFields;
    @Field(value = "summary")
    private String summary;
    @Field(value = "authors")
    private String authors;
    @Field(value = "keywords")
    private String keywords;
    private String xmlText;
    private String htmlText;
    private String docType;
    private String xmlTextPure;
    private String htmlTextPure;
    @Field(value = "docTime")
    private Date docTime;
    private String docTimeStr;
    @Field(value = "keynote")
    private String keynote;

    @Basic
    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    @Basic
    public String getLanguage() {
        return language;
    }

    public void setLanguage(String language) {
        this.language = language;
    }

    @Basic
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Basic
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Basic
    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    @Basic
    @Column(name = "create_date")
    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    @Basic
    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    @Basic
    public String getTags() {
        return tags;
    }

    public void setTags(String tags) {
        this.tags = tags;
    }

    @Basic
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Transient
    public String getSearchFields() {
        return searchFields;
    }

    public void setSearchFields(String searchFields) {
        this.searchFields = searchFields;
    }

    @Basic
    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    @Basic
    public String getAuthors() {
        return authors;
    }

    public void setAuthors(String authors) {
        this.authors = authors;
    }

    @Basic
    public String getKeywords() {
        return keywords;
    }

    public void setKeywords(String keywords) {
        this.keywords = keywords;
    }

    @Basic
    public String getXmlText() {
        return xmlText;
    }

    public void setXmlText(String xmlText) {
        this.xmlText = xmlText;
    }

    @Basic
    public String getHtmlText() {
        return htmlText;
    }

    public void setHtmlText(String htmlText) {
        this.htmlText = htmlText;
    }

    @Basic
    public String getDocType() {
        return docType;
    }

    public void setDocType(String docType) {
        this.docType = docType;
    }

    @Transient
    public String getXmlTextPure() {
        return xmlTextPure;
    }

    public void setXmlTextPure(String xmlTextPure) {
        this.xmlTextPure = xmlTextPure;
    }

    @Transient
    public String getHtmlTextPure() {
        return htmlTextPure;
    }

    public void setHtmlTextPure(String htmlTextPure) {
        this.htmlTextPure = htmlTextPure;
    }

    @Basic
    @Column(name = "doc_time")
    public Date getDocTime() {
        return docTime;
    }

    public void setDocTime(Date docTime) {
        this.docTime = docTime;
    }

    @Transient
    public String getDocTimeStr() {
        return docTimeStr;
    }

    public void setDocTimeStr(String docTimeStr) {
        this.docTimeStr = docTimeStr;
    }

    @Basic
    @Column(name = "keynote")
    public String getKeynote() {
        return keynote;
    }

    public void setKeynote(String keynote) {
        this.keynote = keynote;
    }
}
